
{template 'common/header'}
{template 'nav'}
<div class="main">
	{if $op == 'post'}
	<ul class="nav nav-tabs">
		<li class="active" ><a href="{php echo $this->createWebUrl('notice', array('op' => 'post','regionid'=>$_GPC['regionid']));}">设置通知</a></li>
		<li><a href="{php echo $this->createWebUrl('notice', array('op' => 'display','regionid'=>$_GPC['regionid']));}">微信通知设置</a></li>

	</ul>
	<form action="" class="form-horizontal" method="post" enctype="multipart/form-data">
		<input type="hidden" name="id" value="{$item['id']}">
		    <div class="panel panel-default">
		  	  <div class="panel-heading">
			    <h3 class="panel-title">注意：粉丝OPENID从粉丝营销的粉丝管理里面取得</h3>
			  </div>
			  <div class="panel-body">
			  		<div class="form-group">
					    <label for="title" class="col-sm-2 control-label">微信号标识</label>
					    <div class="col-sm-4">
					      
							  <input type="text" name="fansopenid"  value="" class="form-control">
							
					    </div>
					</div>
					<div>
					
					<div class="form-group">
					    <label for="title" class="col-sm-2 control-label">报修是否启用</label>
					    <div class="col-sm-4">
					      <label class="radio-inline">
							  <input type="radio" name="repair_status" id="" value="2" {if $item['repair_status'] == 2 || empty($item['repair_status'])}checked="checked"{/if}> 是
							</label>
							<label class="radio-inline">
							  <input type="radio" name="repair_status" id="" value="1" {if $item['repair_status'] == 1 }checked="checked"{/if}> 否
							</label>
					    </div>
					</div>
					<div class="form-group">
					    <label for="title" class="col-sm-2 control-label">投诉是否启用</label>
					    <div class="col-sm-4">
					      <label class="radio-inline">
							  <input type="radio" name="report_status" id="" value="2" {if $item['report_status'] == 2 || empty($item['report_status'])}checked="checked"{/if}> 是
							</label>
							<label class="radio-inline">
							  <input type="radio" name="report_status" id="" value="1" {if $item['report_status'] == 1 }checked="checked"{/if}> 否
							</label>
					    </div>
					</div>
					 <div class="form-group">
					    <label for="" class="col-sm-2 control-label"></label>
					    <div class="col-sm-10">
							<button type="submit" class="btn btn-primary span3" name="submit" value="提交">提交</button>
							<input type="hidden" name="token" value="{$_W['token']}" />
					    </div>
					 </div>
			  </div>
		    </div>
	</form>

{elseif $op == 'display'}
	<ul class="nav nav-tabs">
		<li class="active"><a href="{php echo $this->createWebUrl('notice', array('op' => 'display','regionid'=>$_GPC['regionid']));}">微信设置</a></li>

	</ul>
	<div style="padding:15px;">
		<div style="margin-bottom:2px;text-align:right"><a class="btn btn-success" 
		href="{php echo $this->createWebUrl('notice',array('op' => 'post','regionid' => $_GPC['regionid']))}"><i class="glyphicon glyphicon-plus"></i>添加微信号</a></div>
		<table class="table table-hover table-bordered" >
			<thead class="navbar-inner">
				<tr>
					<th style="width:80px;">微信标识</th>
					<th style="width:40px;">报修是否启用</th>
					<th style="width:40px;">投诉是否启用</th>
					<th style="width:40px;">操作</th>
				</tr>
			</thead>
			<tbody>
				{loop $list $item}
				<tr>
					<td>{$item['fansopenid']}</td>
					<td><input type="checkbox" name="repair_status" id="" value="2" {if $item['repair_status'] == 2 || empty($item['repair_status'])}checked="checked"{/if}> 是</td>
					<td><input type="checkbox" name="repair_status" id="" value="2" {if $item['report_status'] == 2 || empty($item['report_status'])}checked="checked"{/if}> 是</td>
					<td>
						<a href="JavaScript:;" data="{$item['id']}" class="del_peo"><i class="fa fa-trash-o text-sg"></i> 删除微信 </a>
					</td>
				</tr>
				{/loop}
			</tbody>
		</table>
		{$pager}
	</div>
{/if}
	</div>
</div>
<script type="text/javascript">
 $(function () {
        $(".del_peo").bind("click",function(){
            var id = $(this).attr('data');
	        var url = "{php echo $this->createWebUrl('notice',array('op' => 'delete'))}";
	            $.post(url,
	            {
	                id:id
	            },
	            function(msg){
	                    if (msg.status == 1) {
	                    	setTimeout(function(){
	                        	window.location.reload();
	                   		 },1000);
	                    };
	                    
	            },
	            'json');
        });
});
</script>







{template 'common/footer'}